home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 54455 / 54455.xpi / chrome / content / passfinder.js < prev    next >
Text File  |  2009-12-31  |  3KB  |  74 lines

  1. var passfinder = {};
  2.  
  3. passfinder.passfinder = function() {
  4.     var showMe = document.getElementById("shower").style;
  5.     var hideMe = document.getElementById("hider").style;
  6.     var currenttabIndex = gBrowser.tabContainer.getIndexOfItem(gBrowser.selectedTab);
  7.     var currentBrowser = gBrowser.getBrowserAtIndex(currenttabIndex);
  8.     var inputElementList = currentBrowser.contentDocument.getElementsByTagName("input");
  9.     var inputElementsLength = inputElementList.length;    
  10.     // Loop through all the input tags
  11.     for(var j = 0; j < inputElementsLength; j++) {
  12.         inputElement = inputElementList[j];
  13.         // If the element is password
  14.         if(inputElement.hasAttribute("type") && inputElement.getAttribute("type").toLowerCase() == "password") {
  15.             var temp = inputElement.value;
  16.             var tempC = inputElement.offsetwidth;
  17.             inputElement.type = "text";
  18.             inputElement.value = temp; 
  19.             inputElement.setAttribute("tc", 1);
  20.              if(navigator.preference("extensions.passfinder.bold")){
  21.             inputElement.style.fontWeight = "900";
  22.             }
  23.             if(navigator.preference("extensions.passfinder.ital")){
  24.             inputElement.style.fontStyle =  "italic";
  25.             inputElement.offsetwidth= tempC;
  26.             }    
  27.             if(navigator.preference("extensions.passfinder.cuscol")){
  28.                 inputElement.style.color = navigator.preference("extensions.passfinder.fgc");
  29.                 inputElement.style.background = navigator.preference("extensions.passfinder.bgc");
  30.             }
  31.     
  32.         } 
  33.     }
  34.     showMe.display = "none";
  35.     hideMe.display = "";
  36.     navigator.preference("extensions.passfinder.enabled", true);    
  37.     return;    
  38. }
  39.  
  40. passfinder.hidepassword = function() {
  41.     var showMe = document.getElementById("shower").style;
  42.     var hideMe = document.getElementById("hider").style;
  43.     var currenttabIndex = gBrowser.tabContainer.getIndexOfItem(gBrowser.selectedTab);
  44.     var currentBrowser = gBrowser.getBrowserAtIndex(currenttabIndex);
  45.     var inputElementList = currentBrowser.contentDocument.getElementsByTagName("input");
  46.     var inputElementsLength = inputElementList.length;    
  47.     // Loop through all the input tags
  48.     for(var j = 0; j < inputElementsLength; j++) {
  49.         inputElement = inputElementList[j];
  50.         // If the element is password
  51.         if(inputElement.hasAttribute("tc") && inputElement.getAttribute("tc") == 1) {
  52.             var temp = inputElement.value;
  53.             //var tempC = inputElement.style;
  54.             inputElement.type = "password";
  55.             inputElement.value = temp;
  56.             //tempC = inputElement.style;
  57.             inputElement.removeAttribute("tc");
  58.             inputElement.style.color = "#000000";
  59.             inputElement.style.background = "#FFFFFF";
  60.             inputElement.style.fontWeight = "500";
  61.             inputElement.style.fontStyle = "normal";
  62.             } 
  63.     }
  64.     showMe.display = "";
  65.     hideMe.display = "none";
  66.     navigator.preference("extensions.passfinder.enabled", false);
  67.     return;
  68. }
  69.  
  70.  
  71.  
  72.  
  73.  
  74.